﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FazaDemo.BL.Services_;
using NUnit.Framework;

namespace FazaDemo.BL.Services_
{
    [TestFixture]
    public class NavTittleGeneratorTests : EcqTextParserTestsBase
    {

        private NavTittleGenerator _generator;

        [SetUp]
        public void TestInit()
        {
            _generator = new NavTittleGenerator();
        }

        [Test]
        [TestCaseSource("GetCorrectCases")]
        public string GetTittle_VarEcqs_Garble(string ecqText)
        {
            try
            {
                string result = _generator.GetTittle(ecqText);
                return _generator.GetTittle(ecqText);
            }
            catch (Exception)
            {
                return null;
            }
        }

        private IEnumerable<TestCaseData> GetCorrectCases()
        {
            TestBaseInit();
            yield return new TestCaseData(_getEcqById(1062).ECQ).Returns("Лицевые счета");
            yield return new TestCaseData(_getEcqById(1059).ECQ).Returns("Начисления");
            yield return new TestCaseData(_getEcqById(1061).ECQ).Returns("Квитанции");
        }

    }
}
